package com.ruoyi.user.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.user.mapper.AtbUserMapper;
import com.ruoyi.user.domain.AtbUser;
import com.ruoyi.user.service.IAtbUserService;

/**
 * 用户Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-09-14
 */
@Service
public class AtbUserServiceImpl implements IAtbUserService 
{
    @Autowired
    private AtbUserMapper atbUserMapper;

    /**
     * 查询用户
     * 
     * @param id 用户主键
     * @return 用户
     */
    @Override
    public AtbUser selectAtbUserById(Long id)
    {
        return atbUserMapper.selectAtbUserById(id);
    }

    /**
     * 查询用户列表
     * 
     * @param atbUser 用户
     * @return 用户
     */
    @Override
    public List<AtbUser> selectAtbUserList(AtbUser atbUser)
    {
        return atbUserMapper.selectAtbUserList(atbUser);
    }

    /**
     * 新增用户
     * 
     * @param atbUser 用户
     * @return 结果
     */
    @Override
    public int insertAtbUser(AtbUser atbUser)
    {
        atbUser.setCreateTime(DateUtils.getNowDate());
        return atbUserMapper.insertAtbUser(atbUser);
    }

    /**
     * 修改用户
     * 
     * @param atbUser 用户
     * @return 结果
     */
    @Override
    public int updateAtbUser(AtbUser atbUser)
    {
        return atbUserMapper.updateAtbUser(atbUser);
    }

    /**
     * 批量删除用户
     * 
     * @param ids 需要删除的用户主键
     * @return 结果
     */
    @Override
    public int deleteAtbUserByIds(Long[] ids)
    {
        return atbUserMapper.deleteAtbUserByIds(ids);
    }

    /**
     * 删除用户信息
     * 
     * @param id 用户主键
     * @return 结果
     */
    @Override
    public int deleteAtbUserById(Long id)
    {
        return atbUserMapper.deleteAtbUserById(id);
    }
}
